package com.bjwl.wybx.util;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Result {
    private boolean success;
    private String message;
    private Object data;
    private boolean isLoginSign;

    //写构造函数
    public Result( boolean success,String message, Object data) {
        super();
        this.success = success;
        this.message = message;
        this.data = data;
        this.isLoginSign=true; //已登录
    }
    public Result() {
        //默认为未登录，
        this.isLoginSign = false;
    }
    //未登录的方法
    public static Result unLogin() {
        return new Result();
    }
    public static Result success(){
        return new Result(true,null,null);
    }
    public static Result success(String message){
        return new Result(true,message,null);
    }
    public static Result success(String message,Object data){
        return new Result(true,message,data);
    }
    public static Result fail(){
        return new Result(false,null,null);
    }
    public static Result fail(String message){
        return new Result(false,message,null);
    }
    public static Result fail(String message,Object data){
        return new Result(false,message,data);
    }
}
